package hk.linkcredit.awardservice.award.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import hk.linkcredit.awardservice.award.domain.entity.AwardGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 奖励分组Mapper接口
 *
 * @author african-loan
 * @date 2022-06-22
 */
public interface AwardGroupMapper extends BaseMapper<AwardGroup>{

    @Select("SELECT group_code FROM award_act_group_relation a LEFT JOIN award_group b ON a.group_id=b.id WHERE a.act_id=#{actId}")
    List<String> getGroups(@Param("actId") Long id);
}
